﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional

namespace TrackSystem.EntityFramework.Migrations
{
    /// <inheritdoc />
    public partial class cm9 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_alarm",
                table: "alarm");

            migrationBuilder.DeleteData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "3604f82d-7fc0-411f-8d9b-e8f152757443");

            migrationBuilder.DeleteData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "42cecf2d-a96a-44b8-9d29-02b480bc0515");

            migrationBuilder.DeleteData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "ce829965-368c-4860-8cc9-52d5d451e84a");

            migrationBuilder.DeleteData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "eed9ea9b-743d-4281-86a7-28ee1a38c74d");

            migrationBuilder.DeleteData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "ef49eccb-4a23-465f-9474-ca2836481787");

            migrationBuilder.RenameTable(
                name: "alarm",
                newName: "Alarm");

            migrationBuilder.AlterColumn<string>(
                name: "Description",
                table: "Alarm",
                type: "varchar(500)",
                maxLength: 500,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "longtext",
                oldNullable: true)
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddPrimaryKey(
                name: "PK_Alarm",
                table: "Alarm",
                column: "Id");

            migrationBuilder.InsertData(
                table: "AspNetRoles",
                columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
                values: new object[,]
                {
                    { "0d23293e-6d0f-42c5-ab1e-fc77d822f23c", null, "Admin", "ADMIN" },
                    { "2fbc2f91-71ed-4b39-afdc-508c57b23410", null, "Eng", "Engineer" },
                    { "40c292dc-9d43-4712-bf8c-855a70d00cc8", null, "Op", "Operator" },
                    { "7ebc0479-e633-4f12-a8cf-50ee9c9abe72", null, "User", "User" },
                    { "c5436f2d-08f9-4f2c-814c-091f759039b7", null, "Guest", "Guest" }
                });

            migrationBuilder.CreateIndex(
                name: "IX_Alarm_Id",
                table: "Alarm",
                column: "Id",
                unique: true);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_Alarm",
                table: "Alarm");

            migrationBuilder.DropIndex(
                name: "IX_Alarm_Id",
                table: "Alarm");

            migrationBuilder.DeleteData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "0d23293e-6d0f-42c5-ab1e-fc77d822f23c");

            migrationBuilder.DeleteData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "2fbc2f91-71ed-4b39-afdc-508c57b23410");

            migrationBuilder.DeleteData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "40c292dc-9d43-4712-bf8c-855a70d00cc8");

            migrationBuilder.DeleteData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "7ebc0479-e633-4f12-a8cf-50ee9c9abe72");

            migrationBuilder.DeleteData(
                table: "AspNetRoles",
                keyColumn: "Id",
                keyValue: "c5436f2d-08f9-4f2c-814c-091f759039b7");

            migrationBuilder.RenameTable(
                name: "Alarm",
                newName: "alarm");

            migrationBuilder.AlterColumn<string>(
                name: "Description",
                table: "alarm",
                type: "longtext",
                nullable: true,
                oldClrType: typeof(string),
                oldType: "varchar(500)",
                oldMaxLength: 500,
                oldNullable: true)
                .Annotation("MySql:CharSet", "utf8mb4")
                .OldAnnotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddPrimaryKey(
                name: "PK_alarm",
                table: "alarm",
                column: "Id");

            migrationBuilder.InsertData(
                table: "AspNetRoles",
                columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
                values: new object[,]
                {
                    { "3604f82d-7fc0-411f-8d9b-e8f152757443", null, "Admin", "ADMIN" },
                    { "42cecf2d-a96a-44b8-9d29-02b480bc0515", null, "User", "User" },
                    { "ce829965-368c-4860-8cc9-52d5d451e84a", null, "Eng", "Engineer" },
                    { "eed9ea9b-743d-4281-86a7-28ee1a38c74d", null, "Guest", "Guest" },
                    { "ef49eccb-4a23-465f-9474-ca2836481787", null, "Op", "Operator" }
                });
        }
    }
}
